package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.constant.MessageConst;
import com.itheima.entity.Result;
import com.itheima.pojo.CheckItem;
import com.itheima.pojo.Role;
import com.itheima.service.RoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Administrator
 * @Date: 2020/3/7 17:23
 * @Description:
 */
@RestController
@RequestMapping("/role")
@Slf4j
public class RoleController {

    @Reference
    RoleService roleService;


    @RequestMapping("/findAll")
    public Result findAll(){
        log.debug("findAll:");
        List<Role>roleList= roleService.findAll();
        log.debug("查询所有角色成功!!");
        return new Result(true, "查询所有角色成功!!",roleList);
    }
}
